package warehouse;



/**
 * Mouse class extends Item class, contains the mouse objects
 * we are storing in our warehouse
 * @author Apeiranthitis, Grassos, Moschos
 *
 */
public class Mouse extends Item {


	private String type;
	private int buttonNum;
	private String colour;
	
	/** Creates Mouse class constructor and inherits the suitable ones from the Super Class
	 * @param id the item id
	 * @param iPrice the item price
	 * @param quantity the item quantity
	 * @param itemType the item type
	 * @param btnNum the button number of the item
	 * @param colour the color of the item
	 */
	public Mouse (String id, String iPrice, String quantity, String itemType, int btnNum, String colour ){

		super( id, iPrice, quantity);
		setType(itemType);
		setButtonNum(btnNum);
		this.setColour(colour);
	}
	

	//some get and set methods
	public String getType() {
		return type;
	}


	public void setType(String type) {
		this.type = type;
	}


	public int getButtonNum() {
		return buttonNum;
	}


	public void setButtonNum(int buttonNum) {
		this.buttonNum = buttonNum;
	}


	public String getColour() {
		return colour;
	}


	public void setColour(String colour) {
		this.colour = colour;
	}


	/** Overrides toString() method and returns a String sequence
	 * @return String with all the information of a mouse item
	 **/
	@Override
	public String toString() {
		return super.getItemID()+" "+type+" "+colour+" " + super.getQuantity()+"\n" ;
	}


	/** Overrides equals() method and check whether the parameter instance is one of 
	 *  Mouse and returns true if its ID is equal to the another Mouse.
	 * @param Object
	 * return true or false
	 **/
	public boolean equals(Object other){

		if (! (other instanceof Mouse))
			return false;

		Mouse ms = (Mouse) other;
		return this.getItemID().equals( ms.getItemID());
	}

	/** Overrides  compareTo() method and compares its ID to another one
	 * @param Item an item
	 * @return a negative integer if this id comes before the parameter's id,
	 *         zero if they are equal and a positive integer if this
	 *         comes after the other.
	 **/
	public int compareTo(Mouse ms) {
		return this.getItemID().compareTo(ms.getItemID());

	}
	

}